import React from 'react';
import PropTypes from 'prop-types'

class Handler extends React.Component {
  render() {
    return (
      <div>
        <p>{ this.props.name }</p>
        <p>{ this.props.age }</p>
        <p>{ this.props.func() }</p>
      </div>
    )
  }
}

Handler.propTypes = {
  name: PropTypes.string,
  age: PropTypes.number,
  func: PropTypes.func
}

Handler.defaultProps = {
  name: '你好',
  age: 22,
  func: () => {console.log('哈哈哈')}
}

export default Handler